using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class GUI_Webpage_Result : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //check if the button select is Food
        if (Request.QueryString.Get("select") == "Food")
        {
            string foodName = Request.QueryString.Get("foodName");
            FoodInfo foodInfo = new FoodInfo();
            foodInfo.FoodName = foodName;
            FoodBll foodBll = new FoodBll();

            //List all food by food name input from the textbox
            foodBll.ListFoodByFoodName(foodInfo, dlResultFood);
            dlResultRestaurant.Visible = false;
        }
            //if the button select is Restaurant
        else if (Request.QueryString.Get("select") == "Restaurant")
        {
            string resName = Request.QueryString.Get("resName");
            RestaurantInfo resInfo = new RestaurantInfo();
            resInfo.ResName = resName;
            RestaurantBll resBll = new RestaurantBll();

            //List all restaurant by the text input from the textbox
            resBll.ListRestaurantByRestaurantName(resInfo, dlResultRestaurant);
            dlResultFood.Visible = false;
        }
       
    }
}
